<template>
    <div class="execution">
        <basic-container>
            <avue-crud
                       :permission="permissionList"
                       :before-open="beforeOpen"
                       v-model="form"
                       v-bind="bindVal"
                       v-on="onEvent"
                       :page.sync="page"
                       @selection-change='selectionChange'
                       :cell-style="cellStyle"
            >
                <template slot-scope="scope" slot="menuLeft">
                    <el-button
                        type="primary"
                        size="small"
                        v-permission="permissionList.addBtn"
                        @click="handleAddNonTimely">添加非即时退换票
                    </el-button>
                    <el-button
                        type="primary"
                        size="small"
                        v-permission="permissionList.addBtn"
                        @click.stop="handleAddTimely">添加即时退换票
                    </el-button>
                    <el-button
                        type="primary"
                        size="small"
                        v-permission="permissionList.sendBtn"
                        @click.stop="batchSend()">无效票发送
                    </el-button>
                    <el-button
                        type="primary"
                        size="small"
                        v-permission="permissionList.submitBtn"
                        @click.stop="batchSubmit()" v-if="false">提 交
                    </el-button>
                    <el-button
                        type="primary"
                        size="small"
                        v-permission="permissionList.confirmBtn"
                        @click.stop="batchConfirm()">确认领取
                    </el-button>
                    <el-button
                        type="primary"
                        size="small"
                        v-permission="permissionList.delBtn"
                        @click.stop="batchDelete()">删 除
                    </el-button>
                    <el-button
                        type="primary"
                        size="small"
                        @click.stop="ticketHand()">加入车票上交
                    </el-button>
                    <el-button
                        type="primary"
                        size="small"
                        @click.stop="recovery()">加入人工回收
                    </el-button>
                    <el-button type="primary" size="mini" @click="submitData">加入报表差错</el-button>
                    <el-button
                        type="primary"
                        size="small"
                        :hidden="true"
                        v-if="false"
                        @click.stop="handlePrint()">打 印
                    </el-button>
                </template>
                <template slot="menu" slot-scope="{row}">
                  <el-button
                    type="text"
                    size="small"
                    icon="el-icon-edit"
                    v-permission="permissionList.editBtn"
                    v-if="row.submitStatus == '0'
                    && row.invalidTicketConfirmStatus == '0'
                    && row.isMerge == '0'"
                    @click="handleEdit(row)">编 辑
                  </el-button>
                  <el-button
                    type="text"
                    size="small"
                    icon="el-icon-edit"
                    v-permission="permissionList.editBtn"
                    v-if="row.submitStatus == '0'
                    && row.invalidTicketConfirmStatus == '0'
                    && row.isMerge == '1'
                    && row.operationType == '1'"
                    @click="mergeEdit(row)">编 辑
                  </el-button>
                  <el-button
                    type="text"
                    size="small"
                    icon="el-icon-edit"
                    v-permission="permissionList.editBtn"
                    v-if="row.submitStatus == '0'
                    && row.invalidTicketConfirmStatus == '0'
                    && row.isMerge == '1'
                    && row.operationType == '0'"
                    @click="mergeEdits(row)">编 辑
                  </el-button>
                </template>
            </avue-crud>
        </basic-container>
        <open-dialog
          :DialogVisible.sync="mergeEditVisableDialog"
          title="编辑非即时退换票"
          width="60%"
        >
          <el-form v-if="mergeEditVisableDialog">
            <avue-form v-model="formMergeEdit" :option="tableOptionMerge"></avue-form>
            <div class="bottom-menu">
              <el-button type="primary" @click="mergeEditSubmit">保存</el-button>
              <el-button type="primary" @click="mergeEditVisableDialog = false"
                >取消</el-button
              >
            </div>
          </el-form>
        </open-dialog>
        <open-dialog
          :DialogVisible.sync="mergeEditWithVisableDialog"
          title="编辑"
          width="60%"
        >
          <el-form v-if="mergeEditWithVisableDialog">
            <avue-form v-model="formMergeEditForthwith" :option="tableOptionMergeEdit"></avue-form>
            <div class="bottom-menu">
              <el-button type="primary" @click="mergeEditForthwith">保存</el-button>
              <el-button type="primary" @click="mergeEditWithVisableDialog = false"
                >取消</el-button
              >
            </div>
          </el-form>
        </open-dialog>
        <open-dialog
          :DialogVisible.sync="addVisableDialog"
          title="添加非即时退换票"
          width="60%"
        >
          <el-form>
            <avue-form v-model="formAdd" :option="tableOptionAdd"></avue-form>
            <div class="bottom-menu">
              <el-button type="primary" @click="handleAdd">保存</el-button>
              <el-button type="primary" @click="addVisableDialog = false"
                >取消</el-button
              >
            </div>
          </el-form>
        </open-dialog>
        <open-dialog title="添加" :DialogVisible.sync="addVisible">
          <dynamic-crud title="现金事务" :data="timelyTicketList" :option="timelyTableOption"
            :rowAdd="rowAdd">
            <template slot-scope="scope" slot="amount">
              <el-input-number v-model="scope.row.amount" v-show="scope.row.handleType!='1'" :step="0" :precision="2" style="width: 140px"></el-input-number>
              <el-input-number v-model="scope.row.amount" v-show="scope.row.handleType=='1'" disabled="scope.row.handleType=='1'" :step="0" :precision="2" style="width: 140px"></el-input-number>
            </template>
          </dynamic-crud>
          <div style="height: 30px;"></div>
          <avue-form v-model="timelyForm" :option="timelyFormOption"
            @submit="handleSaveTimely"
            @reset-change="handleResetChange">
            <!-- <template slot="totalAmount">
              <span>{{totalAmount}}</span>
            </template> -->
          </avue-form>
        </open-dialog>
        <el-dialog
          width="30%"
          title="领取人确认"
          :visible="dialogFormVisible"
          append-to-body
          center
          :destroy-on-close="true"
        >
        <el-form :model="form1">
          <el-form-item label="领取人密码" prop="password">
            <el-input
              v-model="form1.password"
              type="password"
              autocomplete="off"
            ></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="confirmUser">确 定</el-button>
        </div>
      </el-dialog>
      <addReportEditor ref="addReportEditor" @addReportSuccess="getList"></addReportEditor>
    </div>
</template>

<script>
    import {fetchList, putObj, batchDelete, submit, confirmObj, send, saveNonTimely, saveTimely,getPassengerWorkTicket,queryIds,addTicketHand,addRecovery} from '@/api/subwaystm/swstpassengerworkticket'
    import {tableOption, tableOptionAdd,timelyTableOption, timelyFormOption,tableOptionMerge,tableOptionMergeEdit} from '@/const/crud/subwaystm/swstpassengerworkticket'
    import {dateFormat} from '@/util/date'
    import {mapGetters} from 'vuex'
    import baseCrud from '@/mixins/base-crud';
    import { checkPwd } from "@/api/admin/user";
    import transitUtil from "@/api/subwayRat/transitUtil";
    import store from "@/store";
    import addReportEditor from '@/views/stationTiecketManager/xianWngCJXXQR/BBCCGG/BBCCGGSQ/Editor';

    export default {
        name: 'swstpassengerworkticket',
        mixins: [baseCrud('subwaystm/swstpassengerworkticket')],
        components: {
          addReportEditor
        },
        data() {
            return {
                form1: {
                  password: ""
                },
                formAdd: {},
                searchForm:{
                  submitStatus:'0'
                },
                dialogFormVisible: false,
                addVisableDialog: false,
                tableOptionAdd: tableOptionAdd,
                ids: [],
                timelyTableOption: timelyTableOption,
                timelyFormOption: timelyFormOption,
                form: {},
                addVisible: false,
                timelyTicketList: [],
                timelyForm: {},
                userCode: store.getters.userInfo.userCode,
                tableOptionMerge: tableOptionMerge,
                tableOptionMergeEdit: tableOptionMergeEdit,
                formMergeEdit: {},
                mergeEditVisableDialog: false,
                formMergeEditForthwith: {},
                mergeEditWithVisableDialog: false,
                selectKeys:[]
            }
        },
        computed: {
            ...mapGetters(['permissions']),
            permissionList() {
                return {
                    addBtn: this.vaildData(this.permissions.stm_sw_st_input_passenger_work_ticket_add, false),
                    delBtn: this.vaildData(this.permissions.stm_sw_st_input_passenger_work_ticket_del, false),
                    editBtn: this.vaildData(this.permissions.stm_sw_st_input_passenger_work_ticket_edit, false),
                    submitBtn: this.vaildData(this.permissions.stm_sw_st_input_passenger_work_ticket_submit, false),
                    confirmBtn: this.vaildData(this.permissions.stm_sw_st_input_passenger_work_ticket_confirm, false),
                    sendBtn: this.vaildData(this.permissions.stm_sw_st_input_passenger_work_ticket_send_invalid, false)
                };
            },
            // totalAmount(){
            //   let total = 0
            //   for(let t of this.timelyTicketList){
            //     total += t.amount || 0
            //   }
            //   return total
            // }
        },
        created() {
          this.otherVueAction();
          this.otherVueActionNonTimely();
        },
        watch:{
          'form.reportModifyStatus'(val) {
              //获取渲染列
              var cardOrder = this.findObject(this.tableOption.column, "cardOrder");
              //报表修改状态为修改中并且操作类型为非即时退换票或者即时退换票的情况下不允许修改卡号
              if (val == '1') {
                cardOrder.disabled = true
              }else{
                cardOrder.disabled = false
              }
          },
          //合并状态下的修改非即时退换票
          'formMergeEdit.reportModifyStatus'(val) {
              //获取渲染列
              var cardOrder = this.findObject(this.tableOptionMerge.column, "cardOrder");
              //报表修改状态为修改中并且操作类型为非即时退换票的情况下不允许修改卡号
              if (val == '1' && this.formMergeEdit.operationType == '1') {
                cardOrder.disabled = true
              }else{
                cardOrder.disabled = false
              }
          },
          //合并状态下的修改即时退换票
          'formMergeEditForthwith.reportModifyStatus'(val) {
              //获取渲染列
              var cardOrder = this.findObject(this.tableOptionMergeEdit.column, "cardOrder");
              //报表修改状态为修改中并且操作类型为即时退换票的情况下不允许修改卡号
              if (val == '1' && this.formMergeEditForthwith.operationType == '0') {
                cardOrder.disabled = true
              }else{
                cardOrder.disabled = false
              }
          }
        },
        methods: {
            async submitData() {
              if (this.$refs.crud.tableSelect.length < 1) {
                this.$message.error("请选择数据");
                return false;
              }
              if (this.$refs.crud.tableSelect.length != 1) {
                this.$message.error("只能选择一条数据");
                return false;
              }
              let res = false;
              let ress = false;
              for (const table of this.$refs.crud.tableSelect) {
                let status = await this.querys(table.id);
                if (table.submitStatus != "1") {
                  this.$message.error("请选择已提交的数据");
                  return false;
                }else{
                  if(status == false){
                    return false;
                  }
                  if (table.isAddReprotError == "1") {
                    res = await this.$confirm('该数据已加入报表差错，是否重新加入？', '提示', {
                      confirmButtonText: '是',
                      cancelButtonText: '否',
                      type: 'warning'
                    });
                    if (!res) {
                      return;
                    }else{
                      ress = true;
                    }
                  }
                }
              }
              if(res==false){
                ress = await this.$confirm("是否加入报表差错", "提示", {
                  confirmButtonText: "确认",
                  cancelButtonText: "取消",
                  type: "warning"
                });
              }
              if (!ress) {
                return;
              }
              this.selectKeys = this.$refs.crud.tableSelect;
              let param={
                dialogTitle: "加入报表差错",
                diffAmountId:this.selectKeys[0].id,
                dataSourceTable:"sw_st_input_passenger_work_ticket",
                cardNo:this.selectKeys[0].cardOrder,
                lineCode:this.selectKeys[0].lineCode,
                stationCode:this.selectKeys[0].stationCode,
                //bomCode:this.selectKeys[0].bomCode,
                reprotTime:this.selectKeys[0].handleTime,
                reportNameId:this.selectKeys[0].operationType=='0'?3:9,
                deviceNo:this.selectKeys[0].deviceOperateNum,
                settleBeginTime:this.selectKeys[0].handleTime,
                settleEndTime:this.selectKeys[0].handleTime,
                userCodes:this.selectKeys[0].handlePersonCode,
                showType:3,
                dataSource:1,
                page:this.page
              };
              this.$refs.addReportEditor.others_report_add_call(param);
            },
            //根据id去无效票查询对应的数据，已发送的数据或已入库的数据车站不能申请报表差错
            async querys(id){
              let status = false;
              await queryIds({id:id}).then((res) => {
                if(res.data.code == 0){
                  status =  true;
                }
              }).catch(() => {});
                return status;
            },
            mergeEdit(row){
              this.formMergeEdit = row;
              this.mergeEditVisableDialog = true;
            },
            mergeEdits(row){
              this.formMergeEditForthwith = row;
              this.mergeEditWithVisableDialog = true;
            },
            mergeEditSubmit(){
              putObj(this.formMergeEdit)
                .then((data) => {
                  this.$message.success("修改成功");
                  this.getList(this.page);
                  this.mergeEditVisableDialog = false;
                  this.saveFlag = false;
                  done();
                })
                .catch(() => {});
            },
            mergeEditForthwith(){
              putObj(this.formMergeEditForthwith)
                .then((data) => {
                  this.$message.success("修改成功");
                  this.getList(this.page);
                  this.mergeEditWithVisableDialog = false;
                  this.saveFlag = false;
                  done();
                })
                .catch(() => {});},
            cellStyle({ row, column, rowIndex,columnIndex }) {
              if(2==columnIndex){
                if (row.operationType == '1') {
                  return {
                    color: "red",
                  };
                }
              }
            },
            selectionChange(list) {
                this.ids = list.map(function(value,index,array){
                    return value.id
                })
            },
            beforeOpen(done, type){
              if(type == 'add'){
                // 默认为当天日期-1
                //var day = new Date();
                let now = new Date()
                if(now.getHours() < 6){
                  now.setDate(now.getDate() - 1)
                }
                //day.setTime(day.getTime()-24*60*60*1000);
                setTimeout(()=>{
                  this.form.handleTime = dateFormat(now)
                }, 0)
              }else{
                let replaceCardOrder = this.findObject(this.tableOption.column, 'replaceCardOrder')
                let estimatedNumber = this.findObject(this.tableOption.column, 'estimatedNumber')
                let amount = this.findObject(this.tableOption.column, 'amount')
                let activeTime = this.findObject(this.tableOption.column, 'activeTime')
                let ticketType = this.findObject(this.tableOption.column, 'ticketType')
                let replaceTicketType = this.findObject(this.tableOption.column, 'replaceTicketType')
                let replaceTicketName = this.findObject(this.tableOption.column, 'replaceTicketName')
                if(this.form.operationType == '1'){
                  replaceCardOrder.viewDisplay = true
                  replaceCardOrder.editDisplay = false
                  estimatedNumber.viewDisplay = true
                  estimatedNumber.editDisplay = true
                  amount.viewDisplay = false
                  amount.editDisplay = false
                  activeTime.viewDisplay = true
                  ticketType.disabled = true
                  replaceTicketType.editDisplay = false
                  replaceTicketType.viewDisplay = false
                  replaceTicketName.editDisplay = false
                  replaceTicketName.viewDisplay = false
                }else {
                  replaceCardOrder.viewDisplay = true
                  replaceCardOrder.editDisplay = true
                  estimatedNumber.viewDisplay = false
                  estimatedNumber.editDisplay = false
                  amount.viewDisplay = true
                  amount.editDisplay = true
                  activeTime.viewDisplay = false
                  ticketType.disabled = false
                  if(this.form.handleType == 1){
                    replaceTicketType.editDisplay = true
                    replaceTicketType.viewDisplay = true
                    replaceTicketName.editDisplay = true
                    replaceTicketName.viewDisplay = true
                  }else{
                    replaceTicketType.editDisplay = false
                    replaceTicketType.viewDisplay = false
                    replaceTicketName.editDisplay = false
                    replaceTicketName.viewDisplay = false
                  }
                }
              }
              done()
            },
            handleAddNonTimely: function() {
                for (var i in this.formAdd) {
                    this.formAdd[i] = "";
                }
                this.formAdd.handleType ="1";
                this.formAdd.ticketType ="YXCP";
                let now = new Date();
                if(now.getHours() < 6){
                  now.setDate(now.getDate() - 1)
                }
                this.formAdd.handleTime = dateFormat(now);
                this.addVisableDialog = true;
                //this.$refs.crud.rowAdd()
            },
            handleAdd:function() {
              if (
                this.formAdd.classNumber == "" ||
                this.formAdd.ticketName == "" ||
                this.formAdd.handlePersonName == "" ||
                this.formAdd.handleTime == "" ||
                this.formAdd.cardOrder == ""
              ) {
                this.$message.info("卡号、班次、车票名称、办理人、事务发生时间为必填项！不能为空");
                return;
              }
              if (this.formAdd.cardOrder.length != 10) {
                this.$message.info("卡号必须输入10位!");
                return;
              }
              let now = new Date();
              if (now.getHours() < 6) {
                now.setDate(now.getDate() - 1);
              }
              if(this.formAdd.handleTime < dateFormat(now).substr(0, 10) + " 00:00:00" ||
                this.formAdd.handleTime > dateFormat(now).substr(0, 10) + " 23:59:59"){
                this.$confirm("事务发生时间不是系统默认时间,是否保存？", "提示", {
                  confirmButtonText: "确定",
                  cancelButtonText: "取消",
                  type: "warning"
                }).then(() => {
                  saveNonTimely(this.formAdd)
                    .then((data) => {
                      this.$message.success("添加成功");
                      this.getList(this.page);
                      this.addVisableDialog = false;
                      done();
                    })
                    .catch(() => {});
                })
              } else {
                saveNonTimely(this.formAdd)
                  .then((data) => {
                    this.$message.success("添加成功");
                    this.getList(this.page);
                    this.addVisableDialog = false;
                    done();
                  })
                  .catch(() => {});
              }
            },
            rowSave(row, done,loading) {
              saveNonTimely(row).then(data => {
                this.$message.success('添加成功')
                done()
                this.getList(this.page)
              }).catch(() => {
                loading();
              })
            },
            handleAddTimely(){
              this.timelyTicketList = []
              //this.timelyForm = {}
              for (var i in this.timelyForm) {
                  this.timelyForm[i] = "";
              }
              // 默认为当天日期-1
              var day = new Date();
              //day.setTime(day.getTime()-24*60*60*1000);
              this.timelyForm.handleTime = dateFormat(day)
              this.addVisible = true
            },
            handleSaveTimely(form, done){
              form.swStInputPassengerWorkTimelyTicketList = this.timelyTicketList;
              var list = form.swStInputPassengerWorkTimelyTicketList;
              //0退票 1换票
              if(list.length ==0){
                this.$message.info("票种、车票名称、退款原因是必填项!不能为空");
                done();
                return
              }
              for(const item of list){
                if(
                  this.validatenull(item.ticketType) ||
                  this.validatenull(item.ticketName) ||
                  this.validatenull(item.handleType) ||
                  this.validatenull(item.cardOrder)
                ){
                  this.$message.info("票种、车票名称、退款原因、旧卡号是必填项!不能为空");
                  done();
                  return
                }else{
                  if(item.handleType ==1){
                    if(
                      this.validatenull(item.replaceTicketType) ||
                      this.validatenull(item.replaceTicketName)
                    ){
                      this.$message.info("退款原因为换票的替换票种、替换车票名称是必填项!不能为空");
                      done();
                      return
                    }
                  }
                  //将即时退换票预估值置空
                  item.estimateNumber = null
                }
              }
              //if(list.handleType==null){}
              saveTimely(form).then(response => {
                this.$message.success('添加成功')
                done()
                this.addVisible = false
                this.getList(this.page)
              }).catch(error => {
                console.error(error)
                done()
              })
            },
            rowAdd(callback){
              // 默认差异金额为0
              callback({amount: 0})
            },
            batchSubmit() {
              var tableList = this.$refs.crud.tableSelect;
              if(tableList.length == 0){
                this.$message.info("请选择要提交的记录")
              }
              for(const table of tableList){
                if(table.submitStatus !=0){
                  this.$message.error("请选择未提交的数据!");
                  return false;
                }
              }
              submit(this.ids).then(response => {
                this.$message.success('提交成功')
                this.getList(this.page)
              })
            },
            batchConfirm() {
              if (this.$refs.crud.tableSelect.length < 1) {
                this.$message.error("请选择数据");
                return false;
              }
              this.ids = [];
              for (const table of this.$refs.crud.tableSelect) {
                if (table.invalidTicketConfirmStatus == "5") {
                  this.$message.error("已确认领取，无需重复确认");
                  return false;
                }
                if (table.invalidTicketConfirmStatus != "4") {
                  this.$message.error("请检查数据，只能领取已完善的非即时退换票");
                  return false;
                }
                this.ids.push(table.id);
              }
              this.dialogFormVisible = true;
            },
            confirmUser: function() {
              if (this.form1.password.length == 0) {
                this.$message.error("请输入领取人密码!");
                return false;
              }
              checkPwd(
                  this.userCode,
                  this.form1.password
                ).then(response => {
                  let data = response.data.data;
                  if (data) {
                    confirmObj(this.ids)
                      .then(data => {
                        this.$message.success("领取人确认成功！");
                        this.getList(this.page);
                        done();
                      })
                      .catch(() => {});
                    this.$refs.crud.tableSelect=[];
                    this.dialogFormVisible = false;
                  } else {
                    this.$message.error("用户名或密码不正确！");
                  }
                });
            },
            batchSend() {
              var tableList = this.$refs.crud.tableSelect;
              if(tableList.length == 0){
                this.$message.info('请选择要发送的无效票的数据!')
                return
              }
              for(const table of tableList){
                  if(table.invalidTicketConfirmStatus != 0){
                    this.$message.info('不能重复发送无效票!')
                    return
                  }
              }
              this.$confirm("确认发送无效票?", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
              }).then(() => {
                send(this.ids).then(response => {
                  this.$message.success('发送无效票信息成功')
                  this.getList(this.page)
                })
              });
            },
            //车票上交
            ticketHand() {
              var tableList = this.$refs.crud.tableSelect;
              if(tableList.length == 0){
                this.$message.info('请选择要加入车票上交的数据!')
                return
              }
              for(const table of tableList){
                  if(table.submitStatus == '0' || table.handStatus == '1' || table.operationType != '1'){
                    this.$message.info('只能加入已提交的非即时退换票，且未加入过车票上交的数据!')
                    return
                  }
              }
              this.$confirm("确认添加到车票上交?", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
              }).then(() => {
                addTicketHand(this.ids).then(response => {
                  this.$message.success('加入到车票上交成功')
                  this.getList(this.page)
                })
              });
            },
            //人工回收
            recovery() {
              var tableList = this.$refs.crud.tableSelect;
              if(tableList.length == 0){
                this.$message.info('请选择要加入人工回收的数据!')
                return
              }
              for(const table of tableList){
                 /* 2023-10-30改为所有类型都可以加入人工回收
		  if(table.submitStatus == "0" || table.recoveryStatus == "1" || table.operationType != "1"){
                    this.$message.info('只能加入已提交的非即时退换票，且未加入过人工回收的数据!')
                    return
                  }
                 */
		  if(table.submitStatus == "0" || table.recoveryStatus == "1"){
                    this.$message.info('只能加入已提交，且未加入过人工回收的数据!')
                    return
                  }
              }
              this.$confirm("确认添加到人工回收?", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
              }).then(() => {
                addRecovery(this.ids).then(response => {
                  this.$message.success('加入到人工回收成功')
                  this.getList(this.page)
                })
              });
            },
            batchDelete(){
              var tableList = this.$refs.crud.tableSelect;
              if(tableList.length == 0){
                this.$message.info('请选择要删除的记录!')
                return
              }
              for(const table of tableList){
                if(table.submitStatus !=0){
                  this.$message.error("已提交的数据不能删除!");
                  return false;
                }
                if(table.invalidTicketConfirmStatus !=0){
                  this.$message.error("已发送的无效票数据不能删除!");
                  return false;
                }
                if(table.confirmStatus !=0){
                  this.$message.error("客值已确认的数据不能删除!");
                  return false;
                }
                //报表修改状态下也可以删除
                // if (table.reportModifyStatus == "1") {
                //   this.$message.error("报表修改状态为“是”的情况下，不允许删除数据");
                //   return false;
                // }
                //如果是报表修改状态并且是非即时退换票的不允许删除
                // if (table.reportModifyStatus == "1" && table.operationType == "1") {
                //   this.$message.error("报表修改状态为“是”的情况下，不允许删除数据");
                //   return false;
                // }
              }
              this.$confirm(`是否确认删除这${this.ids.length}条记录`, '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning'
              }).then(() =>{
                return batchDelete(this.ids)
              }).then(() => {
                this.$message.success('删除成功')
                this.getList(this.page)
              })
            },
            handlePrint(){
              this.$refs.crud.rowPrint()
            },
            handleEdit(row){
              this.$refs.crud.rowEdit(row)
            },
            handleResetChange(){
              this.addVisible = false
            },
            otherVueAction(){
              transitUtil.$on('updateReport_call_3',(param)=>{
                let p=param;
                getPassengerWorkTicket(p).then(response => {
                  this.tableData = response.data.data;
                  this.tableLoading = false;
                })
              });
            },
            otherVueActionNonTimely(){
              transitUtil.$on('updateReport_call_9',(param)=>{
                let p=param;
                getPassengerWorkTicket(p).then(response => {
                  this.tableData = response.data.data;
                  this.tableLoading = false;
                })
              });
            }
        }
    }
</script>
<style lang="scss" scoped>
.bottom-menu {
  text-align: center;
}
</style>
